import java.io.PrintWriter;
import java.net.Socket;

public class TCPConnector {

	public void connect(String IP, int port){		
		try {
			String message = "tcp,192.168.1.2,4000:4010,10.0.0.2:10.0.0.10,4000,accept" ;
			Socket client = new Socket(IP,port) ;
			PrintWriter writer= new PrintWriter(client.getOutputStream()) ;			
			new Reader(client,message) ;		
			writer.println(message) ;	
			writer.flush() ;			
		} catch (Exception e) {			
			e.printStackTrace() ;
		}		
	}
	
	public static void main(String[] args){
		TCPConnector conn = new TCPConnector() ;
		//conn.connect("192.168.1.5", 8945) ;
		conn.connect("127.0.0.1", 9870) ;
	}

}
